package xdu.lz.netty.g_handler.en_decode;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageDecoder;

import java.util.List;

/**
 * @author lizhen
 * @date 2019/8/24 21:52
 * @desc  二次解码：把Long解码成String，然后传递给下一个Handler
 */
public class MyMessageToMessageDecoder extends MessageToMessageDecoder<Long> {
    @Override
    protected void decode(ChannelHandlerContext ctx, Long msg, List<Object> out) throws Exception {

        System.out.println("MyMessageToMessageDecoder invoke!");
        out.add(String.valueOf(msg));
    }
}
